<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Cheetah Software: orientation_tools.h Source File</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Cheetah Software
   &#160;<span id="projectnumber">1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="../../annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="../../files.html"><span>File&#160;List</span></a></li>
      <li><a href="../../globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('d4/dfb/orientation__tools_8h_source.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">orientation_tools.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="../../d4/dfb/orientation__tools_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#ifndef LIBBIOMIMETICS_ORIENTATION_TOOLS_H</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#define LIBBIOMIMETICS_ORIENTATION_TOOLS_H</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="../../de/dda/_math_utilities_8h.html">Math/MathUtilities.h</a>&quot;</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="../../d9/d8e/cpp_types_8h.html">cppTypes.h</a>&quot;</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#include &lt;eigen3/Eigen/Dense&gt;</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#include &lt;cmath&gt;</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#include &lt;iostream&gt;</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &lt;type_traits&gt;</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html">   28</a></span>&#160;<span class="keyword">namespace </span><a class="code" href="../../da/d9b/namespaceori.html">ori</a> {</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html#a324ebc9ef2225bdf72de8d94408bf047">   30</a></span>&#160;<span class="keyword">static</span> constexpr <span class="keywordtype">double</span> <a class="code" href="../../da/d9b/namespaceori.html#a324ebc9ef2225bdf72de8d94408bf047">quaternionDerviativeStabilization</a> = 0.1;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html#a02c20a1b1d35988c657aa1e219d609d5">   32</a></span>&#160;<span class="keyword">enum class</span> <a class="code" href="../../da/d9b/namespaceori.html#a02c20a1b1d35988c657aa1e219d609d5">CoordinateAxis</a> { <a class="code" href="../../da/d9b/namespaceori.html#a02c20a1b1d35988c657aa1e219d609d5a02129bb861061d1a052c592e2dc6b383">X</a>, <a class="code" href="../../da/d9b/namespaceori.html#a02c20a1b1d35988c657aa1e219d609d5a57cec4137b614c87cb4e24a3d003a3e0">Y</a>, <a class="code" href="../../da/d9b/namespaceori.html#a02c20a1b1d35988c657aa1e219d609d5a21c2e59531c8710156d34a3c30ac81d5">Z</a> };</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html#ab66b0f13a5bbe6887c815cc1f97b6a13">   38</a></span>&#160;T <a class="code" href="../../da/d9b/namespaceori.html#ab66b0f13a5bbe6887c815cc1f97b6a13">rad2deg</a>(T rad) {</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;  static_assert(std::is_floating_point&lt;T&gt;::value,</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;                <span class="stringliteral">&quot;must use floating point value&quot;</span>);</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;  <span class="keywordflow">return</span> rad * T(180) / T(M_PI);</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;}</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html#abb3365c40bad692ba94734339d8c9df9">   48</a></span>&#160;T <a class="code" href="../../da/d9b/namespaceori.html#abb3365c40bad692ba94734339d8c9df9">deg2rad</a>(T deg) {</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;  static_assert(std::is_floating_point&lt;T&gt;::value,</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;                <span class="stringliteral">&quot;must use floating point value&quot;</span>);</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;  <span class="keywordflow">return</span> deg * T(M_PI) / T(180);</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;}</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html#a537b8d0769c03e4cd8ef2b9a9dc8a760">   60</a></span>&#160;<a class="code" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3&lt;T&gt;</a> <a class="code" href="../../da/d9b/namespaceori.html#a537b8d0769c03e4cd8ef2b9a9dc8a760">coordinateRotation</a>(<a class="code" href="../../da/d9b/namespaceori.html#a02c20a1b1d35988c657aa1e219d609d5">CoordinateAxis</a> axis, T theta) {</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;  static_assert(std::is_floating_point&lt;T&gt;::value,</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;                <span class="stringliteral">&quot;must use floating point value&quot;</span>);</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;  T s = std::sin(theta);</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;  T c = std::cos(theta);</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3&lt;T&gt;</a> R;</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;  <span class="keywordflow">if</span> (axis == <a class="code" href="../../da/d9b/namespaceori.html#a02c20a1b1d35988c657aa1e219d609d5a02129bb861061d1a052c592e2dc6b383">CoordinateAxis::X</a>) {</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    R &lt;&lt; 1, 0, 0, 0, c, s, 0, -s, c;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (axis == <a class="code" href="../../da/d9b/namespaceori.html#a02c20a1b1d35988c657aa1e219d609d5a57cec4137b614c87cb4e24a3d003a3e0">CoordinateAxis::Y</a>) {</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    R &lt;&lt; c, 0, -s, 0, 1, 0, s, 0, c;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (axis == <a class="code" href="../../da/d9b/namespaceori.html#a02c20a1b1d35988c657aa1e219d609d5a21c2e59531c8710156d34a3c30ac81d5">CoordinateAxis::Z</a>) {</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    R &lt;&lt; c, s, 0, -s, c, 0, 0, 0, 1;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;  }</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;  <span class="keywordflow">return</span> R;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;}</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html#add867f41c8046a8bba05611e25c8dfcd">   83</a></span>&#160;<a class="code" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3&lt;typename T::Scalar&gt;</a> <a class="code" href="../../da/d9b/namespaceori.html#add867f41c8046a8bba05611e25c8dfcd">rpyToRotMat</a>(<span class="keyword">const</span> Eigen::MatrixBase&lt;T&gt;&amp; v) {</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;  static_assert(T::ColsAtCompileTime == 1 &amp;&amp; T::RowsAtCompileTime == 3,</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;                <span class="stringliteral">&quot;must have 3x1 vector&quot;</span>);</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3&lt;typename T::Scalar&gt;</a> m = <a class="code" href="../../da/d9b/namespaceori.html#a537b8d0769c03e4cd8ef2b9a9dc8a760">coordinateRotation</a>(<a class="code" href="../../da/d9b/namespaceori.html#a02c20a1b1d35988c657aa1e219d609d5a02129bb861061d1a052c592e2dc6b383">CoordinateAxis::X</a>, v[0]) *</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;                               <a class="code" href="../../da/d9b/namespaceori.html#a537b8d0769c03e4cd8ef2b9a9dc8a760">coordinateRotation</a>(<a class="code" href="../../da/d9b/namespaceori.html#a02c20a1b1d35988c657aa1e219d609d5a57cec4137b614c87cb4e24a3d003a3e0">CoordinateAxis::Y</a>, v[1]) *</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;                               <a class="code" href="../../da/d9b/namespaceori.html#a537b8d0769c03e4cd8ef2b9a9dc8a760">coordinateRotation</a>(<a class="code" href="../../da/d9b/namespaceori.html#a02c20a1b1d35988c657aa1e219d609d5a21c2e59531c8710156d34a3c30ac81d5">CoordinateAxis::Z</a>, v[2]);</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;  <span class="keywordflow">return</span> m;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;}</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html#a153f2a76610f0c5524da3f8bf8fa4dfa">   96</a></span>&#160;<a class="code" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3&lt;typename T::Scalar&gt;</a> <a class="code" href="../../da/d9b/namespaceori.html#a153f2a76610f0c5524da3f8bf8fa4dfa">vectorToSkewMat</a>(<span class="keyword">const</span> Eigen::MatrixBase&lt;T&gt;&amp; v) {</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;  static_assert(T::ColsAtCompileTime == 1 &amp;&amp; T::RowsAtCompileTime == 3,</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;                <span class="stringliteral">&quot;Must have 3x1 matrix&quot;</span>);</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3&lt;typename T::Scalar&gt;</a> m;</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;  m &lt;&lt; 0, -v[2], v[1], v[2], 0, -v[0], -v[1], v[0], 0;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;  <span class="keywordflow">return</span> m;</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;}</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html#a0d9277fde185aecf3eae4a6d6450d25f">  108</a></span>&#160;<a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;typename T::Scalar&gt;</a> <a class="code" href="../../da/d9b/namespaceori.html#a0d9277fde185aecf3eae4a6d6450d25f">matToSkewVec</a>(<span class="keyword">const</span> Eigen::MatrixBase&lt;T&gt;&amp; m) {</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;  static_assert(T::ColsAtCompileTime == 3 &amp;&amp; T::RowsAtCompileTime == 3,</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;                <span class="stringliteral">&quot;Must have 3x3 matrix&quot;</span>);</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;  <span class="keywordflow">return</span> 0.5 * <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;typename T::Scalar&gt;</a>(m(2, 1) - m(1, 2), m(0, 2) - m(2, 0),</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;                                        (m(1, 0) - m(0, 1)));</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;}</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html#a73c3872af6870d856cedd662856fcaea">  119</a></span>&#160;<a class="code" href="../../d9/d8e/cpp_types_8h.html#a8686862774f7c3186c7920447f4de282">Quat&lt;typename T::Scalar&gt;</a> <a class="code" href="../../da/d9b/namespaceori.html#a73c3872af6870d856cedd662856fcaea">rotationMatrixToQuaternion</a>(</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    <span class="keyword">const</span> Eigen::MatrixBase&lt;T&gt;&amp; r1) {</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;  static_assert(T::ColsAtCompileTime == 3 &amp;&amp; T::RowsAtCompileTime == 3,</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;                <span class="stringliteral">&quot;Must have 3x3 matrix&quot;</span>);</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a8686862774f7c3186c7920447f4de282">Quat&lt;typename T::Scalar&gt;</a> q;</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3&lt;typename T::Scalar&gt;</a> r = r1.transpose();</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;  <span class="keyword">typename</span> T::Scalar tr = r.trace();</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;  <span class="keywordflow">if</span> (tr &gt; 0.0) {</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    <span class="keyword">typename</span> T::Scalar S = sqrt(tr + 1.0) * 2.0;</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    q(0) = 0.25 * S;</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    q(1) = (r(2, 1) - r(1, 2)) / S;</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    q(2) = (r(0, 2) - r(2, 0)) / S;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    q(3) = (r(1, 0) - r(0, 1)) / S;</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((r(0, 0) &gt; r(1, 1)) &amp;&amp; (r(0, 0) &gt; r(2, 2))) {</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    <span class="keyword">typename</span> T::Scalar S = sqrt(1.0 + r(0, 0) - r(1, 1) - r(2, 2)) * 2.0;</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    q(0) = (r(2, 1) - r(1, 2)) / S;</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    q(1) = 0.25 * S;</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;    q(2) = (r(0, 1) + r(1, 0)) / S;</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    q(3) = (r(0, 2) + r(2, 0)) / S;</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (r(1, 1) &gt; r(2, 2)) {</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="keyword">typename</span> T::Scalar S = sqrt(1.0 + r(1, 1) - r(0, 0) - r(2, 2)) * 2.0;</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    q(0) = (r(0, 2) - r(2, 0)) / S;</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    q(1) = (r(0, 1) + r(1, 0)) / S;</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    q(2) = 0.25 * S;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    q(3) = (r(1, 2) + r(2, 1)) / S;</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    <span class="keyword">typename</span> T::Scalar S = sqrt(1.0 + r(2, 2) - r(0, 0) - r(1, 1)) * 2.0;</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    q(0) = (r(1, 0) - r(0, 1)) / S;</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    q(1) = (r(0, 2) + r(2, 0)) / S;</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;    q(2) = (r(1, 2) + r(2, 1)) / S;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    q(3) = 0.25 * S;</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;  }</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;  <span class="keywordflow">return</span> q;</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;}</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00160"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html#af88fa91d686c646d41f9b747a6bc90f0">  160</a></span>&#160;<a class="code" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3&lt;typename T::Scalar&gt;</a> <a class="code" href="../../da/d9b/namespaceori.html#af88fa91d686c646d41f9b747a6bc90f0">quaternionToRotationMatrix</a>(</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    <span class="keyword">const</span> Eigen::MatrixBase&lt;T&gt;&amp; q) {</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;  static_assert(T::ColsAtCompileTime == 1 &amp;&amp; T::RowsAtCompileTime == 4,</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;                <span class="stringliteral">&quot;Must have 4x1 quat&quot;</span>);</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;  <span class="keyword">typename</span> T::Scalar e0 = q(0);</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;  <span class="keyword">typename</span> T::Scalar e1 = q(1);</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;  <span class="keyword">typename</span> T::Scalar e2 = q(2);</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;  <span class="keyword">typename</span> T::Scalar e3 = q(3);</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3&lt;typename T::Scalar&gt;</a> R;</div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;  R &lt;&lt; 1 - 2 * (e2 * e2 + e3 * e3), 2 * (e1 * e2 - e0 * e3),</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;      2 * (e1 * e3 + e0 * e2), 2 * (e1 * e2 + e0 * e3),</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;      1 - 2 * (e1 * e1 + e3 * e3), 2 * (e2 * e3 - e0 * e1),</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;      2 * (e1 * e3 - e0 * e2), 2 * (e2 * e3 + e0 * e1),</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;      1 - 2 * (e1 * e1 + e2 * e2);</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;  R.transposeInPlace();</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;  <span class="keywordflow">return</span> R;</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;}</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;</div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00185"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html#add76bed815809cbebd38a8596b0f6224">  185</a></span>&#160;<a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;typename T::Scalar&gt;</a> <a class="code" href="../../da/d9b/namespaceori.html#add76bed815809cbebd38a8596b0f6224">quatToRPY</a>(<span class="keyword">const</span> Eigen::MatrixBase&lt;T&gt;&amp; q) {</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;  static_assert(T::ColsAtCompileTime == 1 &amp;&amp; T::RowsAtCompileTime == 4,</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;                <span class="stringliteral">&quot;Must have 4x1 quat&quot;</span>);</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;typename T::Scalar&gt;</a> rpy;</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;  <span class="keyword">typename</span> T::Scalar as = std::min(-2. * (q[1] * q[3] - q[0] * q[2]), .99999);</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;  rpy(2) =</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;      std::atan2(2 * (q[1] * q[2] + q[0] * q[3]),</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;                 <a class="code" href="../../de/dda/_math_utilities_8h.html#a4f88262a43b7f84fc10183a1f82f6b66">square</a>(q[0]) + <a class="code" href="../../de/dda/_math_utilities_8h.html#a4f88262a43b7f84fc10183a1f82f6b66">square</a>(q[1]) - <a class="code" href="../../de/dda/_math_utilities_8h.html#a4f88262a43b7f84fc10183a1f82f6b66">square</a>(q[2]) - <a class="code" href="../../de/dda/_math_utilities_8h.html#a4f88262a43b7f84fc10183a1f82f6b66">square</a>(q[3]));</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;  rpy(1) = std::asin(as);</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;  rpy(0) =</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;      std::atan2(2 * (q[2] * q[3] + q[0] * q[1]),</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;                 <a class="code" href="../../de/dda/_math_utilities_8h.html#a4f88262a43b7f84fc10183a1f82f6b66">square</a>(q[0]) - <a class="code" href="../../de/dda/_math_utilities_8h.html#a4f88262a43b7f84fc10183a1f82f6b66">square</a>(q[1]) - <a class="code" href="../../de/dda/_math_utilities_8h.html#a4f88262a43b7f84fc10183a1f82f6b66">square</a>(q[2]) + <a class="code" href="../../de/dda/_math_utilities_8h.html#a4f88262a43b7f84fc10183a1f82f6b66">square</a>(q[3]));</div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;  <span class="keywordflow">return</span> rpy;</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;}</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;</div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00201"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html#ade40aba34aa5e6b4f82753eb3c63d16a">  201</a></span>&#160;<a class="code" href="../../d9/d8e/cpp_types_8h.html#a8686862774f7c3186c7920447f4de282">Quat&lt;typename T::Scalar&gt;</a> <a class="code" href="../../da/d9b/namespaceori.html#ade40aba34aa5e6b4f82753eb3c63d16a">rpyToQuat</a>(<span class="keyword">const</span> Eigen::MatrixBase&lt;T&gt;&amp; rpy) {</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;  static_assert(T::ColsAtCompileTime == 1 &amp;&amp; T::RowsAtCompileTime == 3,</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;                <span class="stringliteral">&quot;Must have 3x1 vec&quot;</span>);</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3&lt;typename T::Scalar&gt;</a> R = <a class="code" href="../../da/d9b/namespaceori.html#add867f41c8046a8bba05611e25c8dfcd">rpyToRotMat</a>(rpy);</div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a8686862774f7c3186c7920447f4de282">Quat&lt;typename T::Scalar&gt;</a> q = <a class="code" href="../../da/d9b/namespaceori.html#a73c3872af6870d856cedd662856fcaea">rotationMatrixToQuaternion</a>(R);</div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;  <span class="keywordflow">return</span> q;</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;}</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00213"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html#a90e9fca31a184b48790b43aa6f44fcbd">  213</a></span>&#160;<a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;typename T::Scalar&gt;</a> <a class="code" href="../../da/d9b/namespaceori.html#a90e9fca31a184b48790b43aa6f44fcbd">quatToso3</a>(<span class="keyword">const</span> Eigen::MatrixBase&lt;T&gt;&amp; q) {</div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;  static_assert(T::ColsAtCompileTime == 1 &amp;&amp; T::RowsAtCompileTime == 4,</div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;                <span class="stringliteral">&quot;Must have 4x1 quat&quot;</span>);</div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;typename T::Scalar&gt;</a> so3;</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;  <span class="keyword">typename</span> T::Scalar theta = 2. * std::acos(q[0]);</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;  so3[0] = theta * q[1] / std::sin(theta / 2.);</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;  so3[1] = theta * q[2] / std::sin(theta / 2.);</div><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;  so3[2] = theta * q[3] / std::sin(theta / 2.);</div><div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;  <span class="keywordflow">return</span> so3;</div><div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;}</div><div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;</div><div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00225"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html#a4a1bdfe61995fc50713a5bba4ccbc8cb">  225</a></span>&#160;<a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;typename T::Scalar&gt;</a> <a class="code" href="../../da/d9b/namespaceori.html#a4a1bdfe61995fc50713a5bba4ccbc8cb">rotationMatrixToRPY</a>(<span class="keyword">const</span> Eigen::MatrixBase&lt;T&gt;&amp; R) {</div><div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;  static_assert(T::ColsAtCompileTime == 3 &amp;&amp; T::RowsAtCompileTime == 3,</div><div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;                <span class="stringliteral">&quot;Must have 3x3 matrix&quot;</span>);</div><div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a8686862774f7c3186c7920447f4de282">Quat&lt;typename T::Scalar&gt;</a> q = <a class="code" href="../../da/d9b/namespaceori.html#a73c3872af6870d856cedd662856fcaea">rotationMatrixToQuaternion</a>(R);</div><div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;typename T::Scalar&gt;</a> rpy = <a class="code" href="../../da/d9b/namespaceori.html#add76bed815809cbebd38a8596b0f6224">quatToRPY</a>(q);</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;  <span class="keywordflow">return</span> rpy;</div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;}</div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> T2&gt;</div><div class="line"><a name="l00240"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html#afa58699364d5378139e91ec6f0972475">  240</a></span>&#160;<a class="code" href="../../d9/d8e/cpp_types_8h.html#a8686862774f7c3186c7920447f4de282">Quat&lt;typename T::Scalar&gt;</a> <a class="code" href="../../da/d9b/namespaceori.html#afa58699364d5378139e91ec6f0972475">quatDerivative</a>(<span class="keyword">const</span> Eigen::MatrixBase&lt;T&gt;&amp; q,</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;                                        <span class="keyword">const</span> Eigen::MatrixBase&lt;T2&gt;&amp; omega) {</div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;  static_assert(T::ColsAtCompileTime == 1 &amp;&amp; T::RowsAtCompileTime == 4,</div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;                <span class="stringliteral">&quot;Must have 4x1 quat&quot;</span>);</div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;  static_assert(T2::ColsAtCompileTime == 1 &amp;&amp; T2::RowsAtCompileTime == 3,</div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;                <span class="stringliteral">&quot;Must have 3x1 omega&quot;</span>);</div><div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;  <span class="comment">// first case in rqd</span></div><div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a5e48cf69558cf96d92f71803cf9d19a4">Mat4&lt;typename T::Scalar&gt;</a> Q;</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;  Q &lt;&lt; q[0], -q[1], -q[2], -q[3], q[1], q[0], -q[3], q[2], q[2], q[3], q[0],</div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;      -q[1], q[3], -q[2], q[1], q[0];</div><div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a8686862774f7c3186c7920447f4de282">Quat&lt;typename T::Scalar&gt;</a> qq(</div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;      quaternionDerviativeStabilization * omega.norm() * (1 - q.norm()),</div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;      omega[0], omega[1], omega[2]);</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a8686862774f7c3186c7920447f4de282">Quat&lt;typename T::Scalar&gt;</a> dq = 0.5 * Q * qq;</div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;  <span class="keywordflow">return</span> dq;</div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;}</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;</div><div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00262"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html#a89494866325446c634184782e56113ff">  262</a></span>&#160;<a class="code" href="../../d9/d8e/cpp_types_8h.html#a8686862774f7c3186c7920447f4de282">Quat&lt;typename T::Scalar&gt;</a> <a class="code" href="../../da/d9b/namespaceori.html#a89494866325446c634184782e56113ff">quatProduct</a>(<span class="keyword">const</span> Eigen::MatrixBase&lt;T&gt;&amp; q1,</div><div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;                                     <span class="keyword">const</span> Eigen::MatrixBase&lt;T&gt;&amp; q2) {</div><div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;  <span class="keyword">typename</span> T::Scalar r1 = q1[0];</div><div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;  <span class="keyword">typename</span> T::Scalar r2 = q2[0];</div><div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;typename T::Scalar&gt;</a> v1(q1[1], q1[2], q1[3]);</div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;typename T::Scalar&gt;</a> v2(q2[1], q2[2], q2[3]);</div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;</div><div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;  <span class="keyword">typename</span> T::Scalar r = r1 * r2 - v1.dot(v2);</div><div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;typename T::Scalar&gt;</a> v = r1 * v2 + r2 * v1 + v1.cross(v2);</div><div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a8686862774f7c3186c7920447f4de282">Quat&lt;typename T::Scalar&gt;</a> q(r, v[0], v[1], v[2]);</div><div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;  <span class="keywordflow">return</span> q;</div><div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;}</div><div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;</div><div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> T2, <span class="keyword">typename</span> T3&gt;</div><div class="line"><a name="l00283"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html#ac12ecf143879de178929ecaad1714a6a">  283</a></span>&#160;<a class="code" href="../../d9/d8e/cpp_types_8h.html#a8686862774f7c3186c7920447f4de282">Quat&lt;typename T::Scalar&gt;</a> <a class="code" href="../../da/d9b/namespaceori.html#ac12ecf143879de178929ecaad1714a6a">integrateQuat</a>(<span class="keyword">const</span> Eigen::MatrixBase&lt;T&gt;&amp; quat,</div><div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;                                       <span class="keyword">const</span> Eigen::MatrixBase&lt;T2&gt;&amp; omega,</div><div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;                                       T3 dt) {</div><div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;  static_assert(T::ColsAtCompileTime == 1 &amp;&amp; T::RowsAtCompileTime == 4,</div><div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;                <span class="stringliteral">&quot;Must have 4x1 quat&quot;</span>);</div><div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;  static_assert(T2::ColsAtCompileTime == 1 &amp;&amp; T2::RowsAtCompileTime == 3,</div><div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;                <span class="stringliteral">&quot;Must have 3x1 omega&quot;</span>);</div><div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;typename T::Scalar&gt;</a> axis;</div><div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;  <span class="keyword">typename</span> T::Scalar ang = omega.norm();</div><div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;  <span class="keywordflow">if</span> (ang &gt; 0) {</div><div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;    axis = omega / ang;</div><div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;    axis = <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;typename T::Scalar&gt;</a>(1, 0, 0);</div><div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;  }</div><div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;</div><div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;  ang *= dt;</div><div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;typename T::Scalar&gt;</a> ee = std::sin(ang / 2) * axis;</div><div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a8686862774f7c3186c7920447f4de282">Quat&lt;typename T::Scalar&gt;</a> quatD(std::cos(ang / 2), ee[0], ee[1], ee[2]);</div><div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;</div><div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a8686862774f7c3186c7920447f4de282">Quat&lt;typename T::Scalar&gt;</a> quatNew = <a class="code" href="../../da/d9b/namespaceori.html#a89494866325446c634184782e56113ff">quatProduct</a>(quatD, quat);</div><div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;  quatNew = quatNew / quatNew.norm();</div><div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;  <span class="keywordflow">return</span> quatNew;</div><div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;}</div><div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;</div><div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T, <span class="keyword">typename</span> T2, <span class="keyword">typename</span> T3&gt;</div><div class="line"><a name="l00315"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html#a24ac869b814e7e46a63c4ee97e3279ea">  315</a></span>&#160;<a class="code" href="../../d9/d8e/cpp_types_8h.html#a8686862774f7c3186c7920447f4de282">Quat&lt;typename T::Scalar&gt;</a> <a class="code" href="../../da/d9b/namespaceori.html#a24ac869b814e7e46a63c4ee97e3279ea">integrateQuatImplicit</a>(</div><div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;    <span class="keyword">const</span> Eigen::MatrixBase&lt;T&gt;&amp; quat, <span class="keyword">const</span> Eigen::MatrixBase&lt;T2&gt;&amp; omega,</div><div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;    T3 dt) {</div><div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;  static_assert(T::ColsAtCompileTime == 1 &amp;&amp; T::RowsAtCompileTime == 4,</div><div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;                <span class="stringliteral">&quot;Must have 4x1 quat&quot;</span>);</div><div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;  static_assert(T2::ColsAtCompileTime == 1 &amp;&amp; T2::RowsAtCompileTime == 3,</div><div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;                <span class="stringliteral">&quot;Must have 3x1 omega&quot;</span>);</div><div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;typename T::Scalar&gt;</a> axis;</div><div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;  <span class="keyword">typename</span> T::Scalar ang = omega.norm();</div><div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;  <span class="keywordflow">if</span> (ang &gt; 0) {</div><div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;    axis = omega / ang;</div><div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;    axis = <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;typename T::Scalar&gt;</a>(1, 0, 0);</div><div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;  }</div><div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;</div><div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;  ang *= dt;</div><div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;typename T::Scalar&gt;</a> ee = std::sin(ang / 2) * axis;</div><div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a8686862774f7c3186c7920447f4de282">Quat&lt;typename T::Scalar&gt;</a> quatD(std::cos(ang / 2), ee[0], ee[1], ee[2]);</div><div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;</div><div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a8686862774f7c3186c7920447f4de282">Quat&lt;typename T::Scalar&gt;</a> quatNew = <a class="code" href="../../da/d9b/namespaceori.html#a89494866325446c634184782e56113ff">quatProduct</a>(quat, quatD);</div><div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;  quatNew = quatNew / quatNew.norm();</div><div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;  <span class="keywordflow">return</span> quatNew;</div><div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;}</div><div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;</div><div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00340"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html#a26df2f27ad5ea245384c0e20fb0cb1c2">  340</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="../../da/d9b/namespaceori.html#a26df2f27ad5ea245384c0e20fb0cb1c2">quaternionToso3</a>(<span class="keyword">const</span> <a class="code" href="../../d9/d8e/cpp_types_8h.html#a8686862774f7c3186c7920447f4de282">Quat&lt;T&gt;</a> quat, <a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;T&gt;</a>&amp; so3) {</div><div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;  so3[0] = quat[1];</div><div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;  so3[1] = quat[2];</div><div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;  so3[2] = quat[3];</div><div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;</div><div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;  T theta =</div><div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;      2.0 * asin(sqrt(so3[0] * so3[0] + so3[1] * so3[1] + so3[2] * so3[2]));</div><div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;</div><div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;  <span class="keywordflow">if</span> (fabs(theta) &lt; 0.0000001) {</div><div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;    so3.setZero();</div><div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;    <span class="keywordflow">return</span>;</div><div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;  }</div><div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;  so3 /= sin(theta / 2.0);</div><div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;  so3 *= theta;</div><div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;}</div><div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00356"></a><span class="lineno"><a class="line" href="../../da/d9b/namespaceori.html#a1d645df5c53cbaf41b0a10b46baf8f47">  356</a></span>&#160;<a class="code" href="../../d9/d8e/cpp_types_8h.html#a8686862774f7c3186c7920447f4de282">Quat&lt;T&gt;</a> <a class="code" href="../../da/d9b/namespaceori.html#a1d645df5c53cbaf41b0a10b46baf8f47">so3ToQuat</a>(<a class="code" href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3&lt;T&gt;</a>&amp; so3) {</div><div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;  <a class="code" href="../../d9/d8e/cpp_types_8h.html#a8686862774f7c3186c7920447f4de282">Quat&lt;T&gt;</a> quat;</div><div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;</div><div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;  T theta = sqrt(so3[0] * so3[0] + so3[1] * so3[1] + so3[2] * so3[2]);</div><div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;</div><div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;  <span class="keywordflow">if</span> (fabs(theta) &lt; 1.e-6) {</div><div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;    quat.setZero();</div><div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;    quat[0] = 1.;</div><div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;    <span class="keywordflow">return</span> quat;</div><div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;  }</div><div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;  quat[0] = cos(theta / 2.);</div><div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;  quat[1] = so3[0] / theta * sin(theta / 2.);</div><div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;  quat[2] = so3[1] / theta * sin(theta / 2.);</div><div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;  quat[3] = so3[2] / theta * sin(theta / 2.);</div><div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;  <span class="keywordflow">return</span> quat;</div><div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;}</div><div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;}  <span class="comment">// namespace ori</span></div><div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;</div><div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;<span class="preprocessor">#endif  // LIBBIOMIMETICS_ORIENTATION_TOOLS_H</span></div><div class="ttc" id="namespaceori_html_a24ac869b814e7e46a63c4ee97e3279ea"><div class="ttname"><a href="../../da/d9b/namespaceori.html#a24ac869b814e7e46a63c4ee97e3279ea">ori::integrateQuatImplicit</a></div><div class="ttdeci">Quat&lt; typename T::Scalar &gt; integrateQuatImplicit(const Eigen::MatrixBase&lt; T &gt; &amp;quat, const Eigen::MatrixBase&lt; T2 &gt; &amp;omega, T3 dt)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00315">orientation_tools.h:315</a></div></div>
<div class="ttc" id="namespaceori_html_ab66b0f13a5bbe6887c815cc1f97b6a13"><div class="ttname"><a href="../../da/d9b/namespaceori.html#ab66b0f13a5bbe6887c815cc1f97b6a13">ori::rad2deg</a></div><div class="ttdeci">T rad2deg(T rad)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00038">orientation_tools.h:38</a></div></div>
<div class="ttc" id="namespaceori_html_a02c20a1b1d35988c657aa1e219d609d5a21c2e59531c8710156d34a3c30ac81d5"><div class="ttname"><a href="../../da/d9b/namespaceori.html#a02c20a1b1d35988c657aa1e219d609d5a21c2e59531c8710156d34a3c30ac81d5">ori::CoordinateAxis::Z</a></div></div>
<div class="ttc" id="namespaceori_html_a537b8d0769c03e4cd8ef2b9a9dc8a760"><div class="ttname"><a href="../../da/d9b/namespaceori.html#a537b8d0769c03e4cd8ef2b9a9dc8a760">ori::coordinateRotation</a></div><div class="ttdeci">Mat3&lt; T &gt; coordinateRotation(CoordinateAxis axis, T theta)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00060">orientation_tools.h:60</a></div></div>
<div class="ttc" id="namespaceori_html_add867f41c8046a8bba05611e25c8dfcd"><div class="ttname"><a href="../../da/d9b/namespaceori.html#add867f41c8046a8bba05611e25c8dfcd">ori::rpyToRotMat</a></div><div class="ttdeci">Mat3&lt; typename T::Scalar &gt; rpyToRotMat(const Eigen::MatrixBase&lt; T &gt; &amp;v)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00083">orientation_tools.h:83</a></div></div>
<div class="ttc" id="namespaceori_html_a26df2f27ad5ea245384c0e20fb0cb1c2"><div class="ttname"><a href="../../da/d9b/namespaceori.html#a26df2f27ad5ea245384c0e20fb0cb1c2">ori::quaternionToso3</a></div><div class="ttdeci">void quaternionToso3(const Quat&lt; T &gt; quat, Vec3&lt; T &gt; &amp;so3)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00340">orientation_tools.h:340</a></div></div>
<div class="ttc" id="_math_utilities_8h_html_a4f88262a43b7f84fc10183a1f82f6b66"><div class="ttname"><a href="../../de/dda/_math_utilities_8h.html#a4f88262a43b7f84fc10183a1f82f6b66">square</a></div><div class="ttdeci">T square(T a)</div><div class="ttdef"><b>Definition:</b> <a href="../../de/dda/_math_utilities_8h_source.html#l00015">MathUtilities.h:15</a></div></div>
<div class="ttc" id="cpp_types_8h_html_aa8cb424e643d476ea485238dad7c3e18"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#aa8cb424e643d476ea485238dad7c3e18">Mat3</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, 3, 3 &gt; Mat3</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00054">cppTypes.h:54</a></div></div>
<div class="ttc" id="cpp_types_8h_html_a5e48cf69558cf96d92f71803cf9d19a4"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#a5e48cf69558cf96d92f71803cf9d19a4">Mat4</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, 4, 4 &gt; Mat4</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00094">cppTypes.h:94</a></div></div>
<div class="ttc" id="cpp_types_8h_html_a8686862774f7c3186c7920447f4de282"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#a8686862774f7c3186c7920447f4de282">Quat</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, 4, 1 &gt; Quat</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00058">cppTypes.h:58</a></div></div>
<div class="ttc" id="cpp_types_8h_html_a6f07728c866b15ff0676a9b2ebfd2ba6"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html#a6f07728c866b15ff0676a9b2ebfd2ba6">Vec3</a></div><div class="ttdeci">typename Eigen::Matrix&lt; T, 3, 1 &gt; Vec3</div><div class="ttdef"><b>Definition:</b> <a href="../../d9/d8e/cpp_types_8h_source.html#l00026">cppTypes.h:26</a></div></div>
<div class="ttc" id="cpp_types_8h_html"><div class="ttname"><a href="../../d9/d8e/cpp_types_8h.html">cppTypes.h</a></div></div>
<div class="ttc" id="namespaceori_html_a02c20a1b1d35988c657aa1e219d609d5"><div class="ttname"><a href="../../da/d9b/namespaceori.html#a02c20a1b1d35988c657aa1e219d609d5">ori::CoordinateAxis</a></div><div class="ttdeci">CoordinateAxis</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00032">orientation_tools.h:32</a></div></div>
<div class="ttc" id="namespaceori_html_a1d645df5c53cbaf41b0a10b46baf8f47"><div class="ttname"><a href="../../da/d9b/namespaceori.html#a1d645df5c53cbaf41b0a10b46baf8f47">ori::so3ToQuat</a></div><div class="ttdeci">Quat&lt; T &gt; so3ToQuat(Vec3&lt; T &gt; &amp;so3)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00356">orientation_tools.h:356</a></div></div>
<div class="ttc" id="namespaceori_html_ac12ecf143879de178929ecaad1714a6a"><div class="ttname"><a href="../../da/d9b/namespaceori.html#ac12ecf143879de178929ecaad1714a6a">ori::integrateQuat</a></div><div class="ttdeci">Quat&lt; typename T::Scalar &gt; integrateQuat(const Eigen::MatrixBase&lt; T &gt; &amp;quat, const Eigen::MatrixBase&lt; T2 &gt; &amp;omega, T3 dt)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00283">orientation_tools.h:283</a></div></div>
<div class="ttc" id="namespaceori_html_add76bed815809cbebd38a8596b0f6224"><div class="ttname"><a href="../../da/d9b/namespaceori.html#add76bed815809cbebd38a8596b0f6224">ori::quatToRPY</a></div><div class="ttdeci">Vec3&lt; typename T::Scalar &gt; quatToRPY(const Eigen::MatrixBase&lt; T &gt; &amp;q)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00185">orientation_tools.h:185</a></div></div>
<div class="ttc" id="namespaceori_html_a324ebc9ef2225bdf72de8d94408bf047"><div class="ttname"><a href="../../da/d9b/namespaceori.html#a324ebc9ef2225bdf72de8d94408bf047">ori::quaternionDerviativeStabilization</a></div><div class="ttdeci">static constexpr double quaternionDerviativeStabilization</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00030">orientation_tools.h:30</a></div></div>
<div class="ttc" id="namespaceori_html_a73c3872af6870d856cedd662856fcaea"><div class="ttname"><a href="../../da/d9b/namespaceori.html#a73c3872af6870d856cedd662856fcaea">ori::rotationMatrixToQuaternion</a></div><div class="ttdeci">Quat&lt; typename T::Scalar &gt; rotationMatrixToQuaternion(const Eigen::MatrixBase&lt; T &gt; &amp;r1)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00119">orientation_tools.h:119</a></div></div>
<div class="ttc" id="namespaceori_html_a89494866325446c634184782e56113ff"><div class="ttname"><a href="../../da/d9b/namespaceori.html#a89494866325446c634184782e56113ff">ori::quatProduct</a></div><div class="ttdeci">Quat&lt; typename T::Scalar &gt; quatProduct(const Eigen::MatrixBase&lt; T &gt; &amp;q1, const Eigen::MatrixBase&lt; T &gt; &amp;q2)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00262">orientation_tools.h:262</a></div></div>
<div class="ttc" id="namespaceori_html_a90e9fca31a184b48790b43aa6f44fcbd"><div class="ttname"><a href="../../da/d9b/namespaceori.html#a90e9fca31a184b48790b43aa6f44fcbd">ori::quatToso3</a></div><div class="ttdeci">Vec3&lt; typename T::Scalar &gt; quatToso3(const Eigen::MatrixBase&lt; T &gt; &amp;q)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00213">orientation_tools.h:213</a></div></div>
<div class="ttc" id="namespaceori_html_ade40aba34aa5e6b4f82753eb3c63d16a"><div class="ttname"><a href="../../da/d9b/namespaceori.html#ade40aba34aa5e6b4f82753eb3c63d16a">ori::rpyToQuat</a></div><div class="ttdeci">Quat&lt; typename T::Scalar &gt; rpyToQuat(const Eigen::MatrixBase&lt; T &gt; &amp;rpy)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00201">orientation_tools.h:201</a></div></div>
<div class="ttc" id="namespaceori_html_abb3365c40bad692ba94734339d8c9df9"><div class="ttname"><a href="../../da/d9b/namespaceori.html#abb3365c40bad692ba94734339d8c9df9">ori::deg2rad</a></div><div class="ttdeci">T deg2rad(T deg)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00048">orientation_tools.h:48</a></div></div>
<div class="ttc" id="_math_utilities_8h_html"><div class="ttname"><a href="../../de/dda/_math_utilities_8h.html">MathUtilities.h</a></div><div class="ttdoc">Utility functions for math. </div></div>
<div class="ttc" id="namespaceori_html_a153f2a76610f0c5524da3f8bf8fa4dfa"><div class="ttname"><a href="../../da/d9b/namespaceori.html#a153f2a76610f0c5524da3f8bf8fa4dfa">ori::vectorToSkewMat</a></div><div class="ttdeci">Mat3&lt; typename T::Scalar &gt; vectorToSkewMat(const Eigen::MatrixBase&lt; T &gt; &amp;v)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00096">orientation_tools.h:96</a></div></div>
<div class="ttc" id="namespaceori_html_a0d9277fde185aecf3eae4a6d6450d25f"><div class="ttname"><a href="../../da/d9b/namespaceori.html#a0d9277fde185aecf3eae4a6d6450d25f">ori::matToSkewVec</a></div><div class="ttdeci">Vec3&lt; typename T::Scalar &gt; matToSkewVec(const Eigen::MatrixBase&lt; T &gt; &amp;m)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00108">orientation_tools.h:108</a></div></div>
<div class="ttc" id="namespaceori_html"><div class="ttname"><a href="../../da/d9b/namespaceori.html">ori</a></div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00028">orientation_tools.h:28</a></div></div>
<div class="ttc" id="namespaceori_html_a4a1bdfe61995fc50713a5bba4ccbc8cb"><div class="ttname"><a href="../../da/d9b/namespaceori.html#a4a1bdfe61995fc50713a5bba4ccbc8cb">ori::rotationMatrixToRPY</a></div><div class="ttdeci">Vec3&lt; typename T::Scalar &gt; rotationMatrixToRPY(const Eigen::MatrixBase&lt; T &gt; &amp;R)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00225">orientation_tools.h:225</a></div></div>
<div class="ttc" id="namespaceori_html_af88fa91d686c646d41f9b747a6bc90f0"><div class="ttname"><a href="../../da/d9b/namespaceori.html#af88fa91d686c646d41f9b747a6bc90f0">ori::quaternionToRotationMatrix</a></div><div class="ttdeci">Mat3&lt; typename T::Scalar &gt; quaternionToRotationMatrix(const Eigen::MatrixBase&lt; T &gt; &amp;q)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00160">orientation_tools.h:160</a></div></div>
<div class="ttc" id="namespaceori_html_a02c20a1b1d35988c657aa1e219d609d5a57cec4137b614c87cb4e24a3d003a3e0"><div class="ttname"><a href="../../da/d9b/namespaceori.html#a02c20a1b1d35988c657aa1e219d609d5a57cec4137b614c87cb4e24a3d003a3e0">ori::CoordinateAxis::Y</a></div></div>
<div class="ttc" id="namespaceori_html_a02c20a1b1d35988c657aa1e219d609d5a02129bb861061d1a052c592e2dc6b383"><div class="ttname"><a href="../../da/d9b/namespaceori.html#a02c20a1b1d35988c657aa1e219d609d5a02129bb861061d1a052c592e2dc6b383">ori::CoordinateAxis::X</a></div></div>
<div class="ttc" id="namespaceori_html_afa58699364d5378139e91ec6f0972475"><div class="ttname"><a href="../../da/d9b/namespaceori.html#afa58699364d5378139e91ec6f0972475">ori::quatDerivative</a></div><div class="ttdeci">Quat&lt; typename T::Scalar &gt; quatDerivative(const Eigen::MatrixBase&lt; T &gt; &amp;q, const Eigen::MatrixBase&lt; T2 &gt; &amp;omega)</div><div class="ttdef"><b>Definition:</b> <a href="../../d4/dfb/orientation__tools_8h_source.html#l00240">orientation_tools.h:240</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../dir_43e0a1f539e00dcfa1a6bc4d4fee4fc2.html">home</a></li><li class="navelem"><a class="el" href="../../dir_61bfb0b3cdda81b1b0355ba34eb3b1eb.html">dhkim</a></li><li class="navelem"><a class="el" href="../../dir_adee5b101e079090017bb4e91c628ead.html">Public_Repository</a></li><li class="navelem"><a class="el" href="../../dir_7fc07a7b97001e7b1d18e11da761e2de.html">Cheetah-Software</a></li><li class="navelem"><a class="el" href="../../dir_860379c26524a894b3cf97b5b1ba5bdb.html">common</a></li><li class="navelem"><a class="el" href="../../dir_275ce76ae8a9e2090fbb7142d3994a0e.html">include</a></li><li class="navelem"><a class="el" href="../../dir_584205112fbaf643cea6b51b9cb6fcc8.html">Math</a></li><li class="navelem"><a class="el" href="../../d4/dfb/orientation__tools_8h.html">orientation_tools.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
